#ifndef _TIMER_H
#define _TIMER_H

#include "StringUtils.h"
#include "Logger.h"
#include "Event.h"
#include "EventData.h"

#ifdef GALLIUMENGINE_DLL 
#define GALLIUMENGINE_API __declspec( dllexport )
#else
#define GALLIUMENGINE_API __declspec( dllimport )
#endif

namespace GalliumEngine
{

	class Timer
	{
	private:
		bool running;
		bool repeats;
		float elapsedTime;
		float duration;
	public:
		Timer(void);
		GALLIUMENGINE_API Timer(float _duration);
		GALLIUMENGINE_API Timer(float _duration, bool _repeats);
		GALLIUMENGINE_API ~Timer();

		GALLIUMENGINE_API void start();
		GALLIUMENGINE_API void pause();
		GALLIUMENGINE_API void unPause();
		GALLIUMENGINE_API void stop();

		GALLIUMENGINE_API void setRepeat(bool _repeats);
		GALLIUMENGINE_API bool getRepeat();
	
		GALLIUMENGINE_API void update(float delta);

		Event<EventData> OnExpired;
	};

}


#endif